#ifndef CAPFNODE_H_
#define CAPFNODE_H_

#include <vector>
#include "../../base/cobject.h"

using namespace std;

/**
 * CAPFNode - class representing block of parsed APF file
 * @author Michal Rost
 * @date 14.04.2008
 */
class CAPFNode : public CObject {
public:
  CAPFNode(string name = "", string value = "", CAPFNode* parentNodePtr = NULL);
  CAPFNode(const CAPFNode &node);
  ~CAPFNode();
  CAPFNode& operator=(const CAPFNode &node);
  string getName() const;
  string getValue() const;
  vector<CAPFNode*>* getSubNodesPtr() const;
  CAPFNode* getLatestSubNodePtr() const;
  CAPFNode* getParentNodePtr() const;
  CAPFNode* createSubNode(string name, string value = "");
  void setValue(string value);
  string toString();
  static string getClassName() {
    return "CAPFNode";
  }
protected:
  string name;
  string value;
  CAPFNode* parentNodePtr;
  vector<CAPFNode*>* subNodes;
  void init(string name, string value, CAPFNode* parentNodePtr);
  void copyFrom(const CAPFNode &node);
  void free();
};

#endif
